/**
 * Project: apollo-base-dal
 * 
 * File Created at 2017年2月19日
 * 
 * Copyright 2015-2016 dx.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DongXue software Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with dx.com.
 */
package com.dx.pf.dal.utils;

/** 
* @ClassName: RouteUtil 
* @Description: 路由工具
* @author wuzhenfang(wzfbj2008@163.com)
* @date 2017年2月19日 下午2:22:47 
* @version V1.0 
*/
public class RouteUtil {

	public static final String SQL_TABLE_NAME = "tname";

	public static final String SEPARATOR = "_";

	public static String buildDbName(String dbName, String suffix) {
		return dbName + SEPARATOR + suffix;
	}

	public static String buildTableName(String tableName, String suffix) {
		return tableName + SEPARATOR + suffix;
	}

	public static String formatRouteSuffix(Long key) {
		return String.format("%04d", key);
	}
	
	public static String formatRouteSuffix(int key) {
		return String.format("%04d", key);
	}
	
	public static String formatRouteSuffix(int length, int key) {
		return String.format("%0"+length+"d", key);
	}
	
	public static void main(String[] args) {
		System.out.println(formatRouteSuffix(6,20));
	}
}
